/**
 * Reflectを使った privateフィールド及びprivate関数への外部からの参照
 *
 * to compile : haxe -cp test -swf-version 9 -swf privateAccess.swf -main PrivateAccess
 *
 *
 * 2009/03 IT Planning.
 *
 */

class PrivateAccess
{
	static function main()
	{
		var c = new C ();

		trace(Reflect.field(c, "_privateField") + ",\t" + Reflect.callMethod(c, Reflect.field(c, "_privateFunc"), []));
	}
}

class C
{
	private var _privateField : Int;

	private function _privateFunc () {
		trace("private function call");
		return "called";
	}

	public function new () {
		_privateField = 5;
	}
}